-
Notifications
You must be signed in to change notification settings - Fork 899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set the provider attribute before hostname/ipaddress in EMS factory #20031
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
skateman
force-pushed
the
provider-factories
branch
from
March 31, 2020 11:03
4a9e1f9
to
d78ddfa
Compare
skateman
force-pushed
the
provider-factories
branch
from
March 31, 2020 12:12
d78ddfa
to
a2cf7f2
Compare
skateman
changed the title
[WIP] Adjust EMS factories for the Configuration Management Provider
Build the provider conditionally for EMSes using a trait
Mar 31, 2020
skateman
force-pushed
the
provider-factories
branch
from
March 31, 2020 13:12
a2cf7f2
to
ca3e508
Compare
skateman
changed the title
Build the provider conditionally for EMSes using a trait
Set the provider attribute before hostname/ipaddress in EMS factory
Mar 31, 2020
Checked commit skateman@ca3e508 with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.28.0, and yamllint |
agrare
approved these changes
Mar 31, 2020
3 tasks
NickLaMuro
added a commit
to NickLaMuro/manageiq
that referenced
this pull request
Nov 6, 2020
TRY TO MERGE TO MASTER!!!! This fix takes a page from a PR from David: ManageIQ#20031 Which was that instead of trying to assign the provider prior to making the EMS in the factories, default a provider object type as part of the `ext_management_system` child definition, and reference it in the `let(:provider)`. This is not a problem in Rails 5.2, but does lead to the following error in Rails 6.0 5) ServiceTemplateAnsiblePlaybook.create_catalog_item creates and returns a catalog item Failure/Error: factory_exists?(factory) ? super : class_from_symbol(factory).create!(*args) ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection: Cannot modify association 'ManageIQ::Providers::EmbeddedAnsible::Provider#endpoints' because the source reflection class 'Endpoint' is associated to 'ExtManagementSystem' via :has_many. # ./spec/support/missing_factory_helper.rb:10:in `create' # ./spec/models/service_template_ansible_playbook_spec.rb:11:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:7:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:15:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:40:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:47:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:82:in `block (3 levels) in <top (required)>' Most likely do to a fix that I was unable to track down, but the following `git log command` is most likely to contain some of the commits with the fix: $ git log --oneline -E --grep "has.*many.*through" 5-2-stable..6-0-stable
NickLaMuro
added a commit
to NickLaMuro/manageiq
that referenced
this pull request
Nov 6, 2020
TRY TO MERGE TO MASTER!!!! This fix takes a page from a PR from David: ManageIQ#20031 Which was that instead of trying to assign the provider prior to making the EMS in the factories, default a provider object type as part of the `ext_management_system` child definition, and reference it in the `let(:provider)`. This is not a problem in Rails 5.2, but does lead to the following error in Rails 6.0 5) ServiceTemplateAnsiblePlaybook.create_catalog_item creates and returns a catalog item Failure/Error: factory_exists?(factory) ? super : class_from_symbol(factory).create!(*args) ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection: Cannot modify association 'ManageIQ::Providers::EmbeddedAnsible::Provider#endpoints' because the source reflection class 'Endpoint' is associated to 'ExtManagementSystem' via :has_many. # ./spec/support/missing_factory_helper.rb:10:in `create' # ./spec/models/service_template_ansible_playbook_spec.rb:11:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:7:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:15:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:40:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:47:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:82:in `block (3 levels) in <top (required)>' Most likely do to a fix that I was unable to track down, but the following `git log command` is most likely to contain some of the commits with the fix: $ git log --oneline -E --grep "has.*many.*through" 5-2-stable..6-0-stable
NickLaMuro
added a commit
to NickLaMuro/manageiq
that referenced
this pull request
Nov 6, 2020
TRY TO MERGE TO MASTER!!!! This fix takes a page from a PR from David: ManageIQ#20031 Which was that instead of trying to assign the provider prior to making the EMS in the factories, default a provider object type as part of the `ext_management_system` child definition, and reference it in the `let(:provider)`. This is not a problem in Rails 5.2, but does lead to the following error in Rails 6.0 5) ServiceTemplateAnsiblePlaybook.create_catalog_item creates and returns a catalog item Failure/Error: factory_exists?(factory) ? super : class_from_symbol(factory).create!(*args) ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection: Cannot modify association 'ManageIQ::Providers::EmbeddedAnsible::Provider#endpoints' because the source reflection class 'Endpoint' is associated to 'ExtManagementSystem' via :has_many. # ./spec/support/missing_factory_helper.rb:10:in `create' # ./spec/models/service_template_ansible_playbook_spec.rb:11:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:7:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:15:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:40:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:47:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:82:in `block (3 levels) in <top (required)>' Most likely do to a fix that I was unable to track down, but the following `git log command` is most likely to contain some of the commits with the fix: $ git log --oneline -E --grep "has.*many.*through" 5-2-stable..6-0-stable
NickLaMuro
added a commit
to NickLaMuro/manageiq
that referenced
this pull request
Nov 6, 2020
TRY TO MERGE TO MASTER!!!! This fix takes a page from a PR from David: ManageIQ#20031 Which was that instead of trying to assign the provider prior to making the EMS in the factories, default a provider object type as part of the `ext_management_system` child definition, and reference it in the `let(:provider)`. This is not a problem in Rails 5.2, but does lead to the following error in Rails 6.0 5) ServiceTemplateAnsiblePlaybook.create_catalog_item creates and returns a catalog item Failure/Error: factory_exists?(factory) ? super : class_from_symbol(factory).create!(*args) ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection: Cannot modify association 'ManageIQ::Providers::EmbeddedAnsible::Provider#endpoints' because the source reflection class 'Endpoint' is associated to 'ExtManagementSystem' via :has_many. # ./spec/support/missing_factory_helper.rb:10:in `create' # ./spec/models/service_template_ansible_playbook_spec.rb:11:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:7:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:15:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:40:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:47:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:82:in `block (3 levels) in <top (required)>' Most likely do to a fix that I was unable to track down, but the following `git log command` is most likely to contain some of the commits with the fix: $ git log --oneline -E --grep "has.*many.*through" 5-2-stable..6-0-stable
NickLaMuro
added a commit
to NickLaMuro/manageiq
that referenced
this pull request
Nov 10, 2020
TRY TO MERGE TO MASTER!!!! This fix takes a page from a PR from David: ManageIQ#20031 Which was that instead of trying to assign the provider prior to making the EMS in the factories, default a provider object type as part of the `ext_management_system` child definition, and reference it in the `let(:provider)`. This is not a problem in Rails 5.2, but does lead to the following error in Rails 6.0 5) ServiceTemplateAnsiblePlaybook.create_catalog_item creates and returns a catalog item Failure/Error: factory_exists?(factory) ? super : class_from_symbol(factory).create!(*args) ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection: Cannot modify association 'ManageIQ::Providers::EmbeddedAnsible::Provider#endpoints' because the source reflection class 'Endpoint' is associated to 'ExtManagementSystem' via :has_many. # ./spec/support/missing_factory_helper.rb:10:in `create' # ./spec/models/service_template_ansible_playbook_spec.rb:11:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:7:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:15:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:40:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:47:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:82:in `block (3 levels) in <top (required)>' Most likely do to a fix that I was unable to track down, but the following `git log command` is most likely to contain some of the commits with the fix: $ git log --oneline -E --grep "has.*many.*through" 5-2-stable..6-0-stable
NickLaMuro
added a commit
to NickLaMuro/manageiq
that referenced
this pull request
Nov 10, 2020
…lets This fix takes a page from a PR from David: ManageIQ#20031 Which was that instead of trying to assign the provider prior to making the EMS in the factories, default a provider object type as part of the `ext_management_system` child definition, and reference it in the `let(:provider)`. This is not a problem in Rails 5.2, but does lead to the following error in Rails 6.0 5) ServiceTemplateAnsiblePlaybook.create_catalog_item creates and returns a catalog item Failure/Error: factory_exists?(factory) ? super : class_from_symbol(factory).create!(*args) ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection: Cannot modify association 'ManageIQ::Providers::EmbeddedAnsible::Provider#endpoints' because the source reflection class 'Endpoint' is associated to 'ExtManagementSystem' via :has_many. # ./spec/support/missing_factory_helper.rb:10:in `create' # ./spec/models/service_template_ansible_playbook_spec.rb:11:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:7:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:15:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:40:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:47:in `block (2 levels) in <top (required)>' # ./spec/models/service_template_ansible_playbook_spec.rb:82:in `block (3 levels) in <top (required)>' Most likely do to a fix that I was unable to track down, but the following `git log command` is most likely to contain some of the commits with the fix: $ git log --oneline -E --grep "has.*many.*through" 5-2-stable..6-0-stable
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have a failing spec because the
hostname
andipaddress
fields can't be set in an ems factory. This is because these methods are basically delegated to theprovider
which is not yet associated to the EMS when these two attributes are being set.I found out that the order of these attributes is important, if the first mention of
provider
preceeds the sequences, it will be also assigned sooner. So if I assignnil
to theprovider
attribute before settinghostname
oripaddress
, the provider overridden in child factories will maintain the order of the assignments.Parent issues:
#18818
#19992